/*
 * Copyright (c) 2006 - 2022, webrx.cn All rights reserved.
 *
 */
package cn;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * <p>Project: app2022 - Md5
 * <p>Powered by webrx On 2022-01-14 09:43:22
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Md5 {
    public static void main(String[] args) throws NoSuchAlgorithmException {
        //admin  shiro security
        var pwd = "admin";
        //md5 sha sha1
        var md = MessageDigest.getInstance("sha1");
        md.update(pwd.getBytes());
        var su = new StringBuilder(32);
        for(byte b : md.digest()){
            su.append(String.format("%02x",b));
        }
        System.out.println(pwd);
        System.out.println(su);
        System.out.println(su.toString().length());

    }
}
